#include "shm.hpp"
#include "namedpipe.hpp"

int main()
{
    FileOper fp(PATH, PIPE_NAME);
    fp.OpenForWrite();

    sleep(3);
    Shm shm(PATH_NAME, PROJ_ID, "user");
    shm.Attach();

    printf("%p\n", shm.Virtualaddr());
    char *s = (char *)shm.Virtualaddr();


    int k = 0;
    for (char c = 'A'; c <= 'Z'; c++)
    {
        sleep(1);
        s[k++] = c;
        s[k++] = c;
        s[k] = 0;
        fp.Wakeup();
    }

    shm.Detach();

    fp.Close();

    return 0;
}